import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/bank_list_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class BankListEntity {
  late int code = 0;
  late String msg;
  late BankListData data = BankListData();

  BankListEntity();

  factory BankListEntity.fromJson(Map<String, dynamic> json) => $BankListEntityFromJson(json);

  Map<String, dynamic> toJson() => $BankListEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class BankListData {
  @JSONField(name: "current_page")
  late String currentPage;
  late List<BankListDataData> data = [];

  BankListData();

  factory BankListData.fromJson(Map<String, dynamic> json) => $BankListDataFromJson(json);

  Map<String, dynamic> toJson() => $BankListDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class BankListDataData {
  late String id;
  @JSONField(name: "user_id")
  late String userId;
  late String type;
  @JSONField(name: "real_name")
  late String realName;
  @JSONField(name: "id_number")
  late String idNumber;
  @JSONField(name: "bank_number")
  late String bankNumber;
  @JSONField(name: "bank_name")
  late String bankName;
  late String province;
  late String city;
  late String district;
  @JSONField(name: "bank_branch")
  late String bankBranch;
  late String mobile;
  @JSONField(name: "created_at")
  late String createdAt;
  @JSONField(name: "updated_at")
  late String updatedAt;

  @JSONField(name: "province_name")
  late String provinceName;
  @JSONField(name: "city_name")
  late String cityName;

  BankListDataData();

  factory BankListDataData.fromJson(Map<String, dynamic> json) => $BankListDataDataFromJson(json);

  Map<String, dynamic> toJson() => $BankListDataDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
